import request from '@/utils/request'

// 查询主机分组列表
export function listGroup(query) {
  return request({
    url: '/os/group/list',
    method: 'get',
    params: query
  })
}

// 查询主机分组详细
export function getGroup(id) {
  return request({
    url: '/os/group/' + id,
    method: 'get'
  })
}

// 新增主机分组
export function addGroup(data) {
  return request({
    url: '/os/group',
    method: 'post',
    data: data
  })
}

// 修改主机分组
export function updateGroup(data) {
  return request({
    url: '/os/group',
    method: 'put',
    data: data
  })
}

// 删除主机分组
export function delGroup(id) {
  return request({
    url: '/os/group/' + id,
    method: 'delete'
  })
}


export function addHostToGroup(data) {
  return request({
    url: '/os/group/addHostToGroup',
    method: 'post',
    data: data
  })
}


export function selectHostsByGroupBindStatus(data) {
  return request({
    url: '/os/group/selectHostsByGroupBindStatus',
    method: 'post',
    data: data
  })
}


export function removeHostFromGroup(hostGroupRelIds) {
  return request({
    url: '/os/group/removeHostFromGroup/' + hostGroupRelIds,
    method: 'delete'
  })
}
